﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
             姓名：<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            <asp:RequiredFieldValidator ID="name" runat="server" ErrorMessage="必填" ControlToValidate="TextBox1" Display="Dynamic"></asp:RequiredFieldValidator>
            <asp:CustomValidator ID="admin" runat="server" ErrorMessage="不能取为admin"  ControlToValidate="TextBox1" OnServerValidate="admin_ServerValidate" Display="Dynamic"></asp:CustomValidator>
            <br />
            密码：<asp:TextBox ID="password" runat="server"></asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="必填" ControlToValidate="password" Display="Dynamic"></asp:RequiredFieldValidator>
            <br />
            再次输入密码：<asp:TextBox ID="password2" runat="server"></asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="必填" ControlToValidate="password" Display="Dynamic"></asp:RequiredFieldValidator>
            <asp:CompareValidator ID="CompareValidator1" runat="server" ErrorMessage="密码不一致" ControlToCompare="password" ControlToValidate="password2"></asp:CompareValidator>
            <br />
            年龄：<asp:TextBox ID="age" runat="server"></asp:TextBox>
            <asp:RangeValidator ID="RangeValidator1" runat="server" ErrorMessage="年龄范围在0-100岁之间" ControlToValidate="age" MaximumValue="100" MinimumValue="0" Type="Integer"></asp:RangeValidator>
            <br />
            出生日期：<asp:TextBox ID="birthday" runat="server"></asp:TextBox>
            <asp:RegularExpressionValidator ID="RegEx" runat="server" ErrorMessage="格式不一致" ControlToValidate="birthday" ValidationExpression="\d{4}-\d{2}-\d{2}" Display="Dynamic"></asp:RegularExpressionValidator>
            <asp:RangeValidator ID="birdate" runat="server" ErrorMessage="超出有效日期" ControlToValidate="birthday" Display="Dynamic" OnDataBinding="Page_Load" MinimumValue="1900-01-01" Type="Date"></asp:RangeValidator>
            <br />
            毕业时间：<asp:TextBox ID="graduate" runat="server"></asp:TextBox>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ErrorMessage="格式不一致" ControlToValidate="graduate" ValidationExpression="\d{4}-\d{2}-\d{2}" Display="Dynamic"></asp:RegularExpressionValidator>
            <asp:CompareValidator ID="CompareValidator2" runat="server" ErrorMessage="毕业时间不得大于等于出生时间" ControlToCompare="birthday" ControlToValidate="graduate" Display="Dynamic" Operator="GreaterThan" Type="Date"></asp:CompareValidator>
            <br />
            邮箱：<asp:TextBox ID="mailbox" runat="server"></asp:TextBox>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="格式有误" ControlToValidate="mailbox" ValidationExpression="(\d{10}|\d{9})@(qq|163).com"></asp:RegularExpressionValidator>
            <br />

            <br />
            <asp:Button ID="submit" runat="server" Text="提交" OnClick="submit_Click" />
            <br />
            <asp:Literal ID="tips" runat="server"></asp:Literal>
            <br />
            <asp:ValidationSummary ID="ValidationSummary1" runat="server" DisplayMode="SingleParagraph" ShowMessageBox="True" />
            




            </div>
    </form>
</body>
</html>
